﻿//using System;
//using System.Net;
//using System.Windows;
//using System.Windows.Controls;
//using System.Windows.Documents;
//using System.Windows.Ink;
//using System.Windows.Input;
//using System.Windows.Media;
//using System.Windows.Media.Animation;
//using System.Windows.Shapes;
//
//namespace DanielVaughan.Gui.Animation
//{
//	/* Sourced from http://www.codeproject.com/KB/WPF/GridLengthAnimation.aspx */
//	public class GridLengthAnimation : AnimationTimeline
//	{
//		static GridLengthAnimation()
//		{
//			FromProperty = DependencyProperty.Register("From", typeof(GridLength), typeof(GridLengthAnimation));
//			ToProperty = DependencyProperty.Register("To", typeof(GridLength), typeof(GridLengthAnimation));
//		}
//
//		public override Type TargetPropertyType
//		{
//			get
//			{
//				return typeof(GridLength);
//			}
//		}
//
//		protected override Freezable CreateInstanceCore()
//		{
//			return new GridLengthAnimation();
//		}
//
//		public static readonly DependencyProperty FromProperty;
//
//		public GridLength From
//		{
//			get
//			{
//				return (GridLength)GetValue(FromProperty);
//			}
//			set
//			{
//				SetValue(FromProperty, value);
//			}
//		}
//
//		public static readonly DependencyProperty ToProperty;
//
//		public GridLength To
//		{
//			get
//			{
//				return (GridLength)GetValue(ToProperty);
//			}
//			set
//			{
//				SetValue(ToProperty, value);
//			}
//		}
//
//		public override object GetCurrentValue(
//			object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
//		{
//			double fromVal = ((GridLength)GetValue(FromProperty)).Value;
//			double toVal = ((GridLength)GetValue(ToProperty)).Value;
//
//			if (fromVal > toVal)
//			{
//				return new GridLength((1 - animationClock.CurrentProgress.Value) * (fromVal - toVal) + toVal, GridUnitType.Star);
//			}
//			return new GridLength(animationClock.CurrentProgress.Value * (toVal - fromVal) + fromVal, GridUnitType.Star);
//		}
//	}
//}
